package demo.hashmap;


import java.util.HashMap;
import java.util.Map;

/**
 * @author : feixiang.li
 * @since : 2025-09-18 17:19
 */
public class Main {
    public static void main(String[] args) {
        MyHashMap<String, Integer> map = new MyHashMap<>();
        long start = System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            map.put("key" + i, i);
        }
        int time = (int) (System.currentTimeMillis() - start);
        map.remove("key999");
        System.out.println(map.get("key999"));

        System.out.println("total: " + map.size);
        System.out.println("put time: " + time);

        HashMap<String, Integer> map2 = new HashMap<>();
        long start2 = System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            map2.put("key" + i, i);
        }

        int time2 = (int) (System.currentTimeMillis() - start2);
        System.out.println("put time2: " + time2);
        System.out.println("total2: " + map2.size());
    }
}
